package com.sxf.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.sxf.dao.PostDAO;
import com.sxf.domain.Post;
import com.sxf.domain.PostMeta;
import com.sxf.domain.PostVO;
import com.sxf.mybatis.page.Pagination;
import com.sxf.querybean.PostQuery;
import com.sxf.service.PostService;

public class PostServiceImpl implements PostService {
	private PostDAO dao;

	@Override
	public Pagination<PostVO> queryPage(PostQuery query) {
		return dao.queryPage(query);
	}

	@Override
	public List<PostVO> queryList(PostQuery query) {
		return dao.queryList(query);
	}

	@Override
	public PostVO queryOne(PostQuery query) {
		return dao.queryOne(query);
	}

	@Override
	public long queryNumber(PostQuery query) {
		return dao.queryNumber(query);
	}

	@Override
	public Map<String, Integer> queryStatistic() {
		return dao.queryStatistic();
	}

	public List<Date> getArchivePost() {
		return dao.getArchivePost();
	}

	@Override
	public int insert(Post post) {
		return dao.insert(post);
	}

	@Override
	public int update(Post post) {
		return dao.update(post);
	}

	@Override
	public int delete(Post post) {
		return dao.delete(post);
	}

	@Override
	public long insertPostMeta(PostMeta postMeta) {
		return dao.insertPostMeta(postMeta);
	}

	@Override
	public int updatePostMeta(PostMeta postMeta) {
		return dao.updatePostMeta(postMeta);
	}

	@Override
	public int deletePostMeta(PostMeta postMeta) {
		return dao.deletePostMeta(postMeta);
	}

	public void setDao(PostDAO pd) {
		this.dao = pd;
	}
}
